Skip to content

Allow GPUTexture where GPUTextureView is used #4407

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

beaufortfrancois
Copy link
Collaborator

Spec PR: gpuweb/gpuweb#5228


Requirements for PR author:

  • All missing test coverage is tracked with "TODO" or .unimplemented().
  • New helpers are /** documented */ and new helper files are found in helper_index.txt.
  • Test behaves as expected in a WebGPU implementation. (If not passing, explain above.) They pass in a Chromium build patched with https://chromium-review.googlesource.com/c/chromium/src/+/6656722
  • Test have be tested with compatibility mode validation enabled and behave as expected. (If not passing, explain above.)

Requirements for reviewer sign-off:

  • Tests are properly located in the test tree.
  • Test descriptions allow a reader to "read only the test plans and evaluate coverage completeness", and accurately reflect the test code.
  • Tests provide complete coverage (including validation control cases). Missing coverage MUST be covered by TODOs.
  • Helpers and types promote readability and maintainability.

When landing this PR, be sure to make any necessary issue status updates.

@beaufortfrancois beaufortfrancois marked this pull request as draft June 24, 2025 13:04
@@ -62,7 +62,8 @@ class F extends AllFeaturesMaxLimitsGPUTest {
texture: GPUTexture,
textureViewDescriptor?: GPUTextureViewDescriptor
): GPURenderPassColorAttachment {
const view = texture.createView(textureViewDescriptor);
const { bindTextureResource = false } = this.params as { bindTextureResource?: boolean };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I might be better to just pass in bindTextureResource? This is not type safe. If the parameters change, this will still compile, it will just always be false.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did that because textureViewDescriptor was optional. Maybe I should update getColorAttachment parameters with something like getColorAttachment(texture, {textureViewDescriptor, bindTextureResource}) instead...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@greggman I've fixed this in latest commit.

@@ -76,7 +77,8 @@ class F extends AllFeaturesMaxLimitsGPUTest {
texture: GPUTexture,
textureViewDescriptor?: GPUTextureViewDescriptor
): GPURenderPassDepthStencilAttachment {
const view = texture.createView(textureViewDescriptor);
const { bindTextureResource = false } = this.params as { bindTextureResource?: boolean };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above

@beaufortfrancois beaufortfrancois force-pushed the use-texture branch 2 times, most recently from 3f4bf23 to a4b0960 Compare June 25, 2025 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants